<template>
	<view>
		<uv-swiper radius='0' height='180' :list="list"></uv-swiper>
		<view class="title">
			{{item.title}}
		</view>
		<view class="titleDesc">
			{{item.titleDesc}}
		</view>
		<view class="detailTitle">
			详情
		</view>
		<view class="detail">
			<uv-parse :content="item.content"></uv-parse>
		</view>
	</view>
</template>

<script setup>
	import {
		reactive,
		ref
	} from 'vue';
	import {
		onLoad
	} from '@dcloudio/uni-app'
	//详情数据
	const item = reactive({})
	//轮播图数据
	const list = ref([])
	onLoad((option) => {
		console.log(option)
		let res = JSON.parse(decodeURIComponent(option.item))
		console.log(res)
		Object.assign(item,res)
		if (res.image) {
			//逗号分隔转数组
			let imgs = res.image.split(',')
			for (let i = 0; i < imgs.length; i++) {
				list.value.push(imgs[i])
			}
		}
	})
</script>
<style>
page{
	background-color: #FFF;
}	
</style>
<style scoped lang="scss">
.title{
	background-color: #f1f1f1;
	font-weight: 600;
	padding: 10px;
}
.titleDesc{
	font-size: 28rpx;
	color:#999;
	padding: 10rpx;
}
.detailTitle{
	background-color: #f1f1f1;
	padding: 10px;
	font-weight: 600;
}
.detail{
	padding: 20rpx;
}
</style>
